If we want to use OpenGL ES with EGL then we need to bind the API before
creating the EGL context.
if (!use_es)
{
+ eglBindAPI (EGL_OPENGL_API);
+
/* We want a core profile, unless in legacy mode */
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
context_attribs[i++] = legacy_bit
}
else
{
+ eglBindAPI (EGL_OPENGL_ES_API);
+
context_attribs[i++] = EGL_CONTEXT_CLIENT_VERSION;
if (major == 3)
context_attribs[i++] = 3;
context_attribs[3] = 3;
context_attribs[5] = 0;
+ eglBindAPI (EGL_OPENGL_API);
+
legacy_bit = TRUE;
use_es = FALSE;